﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XiaLastorm.Sharpshooter
{
	/// <summary>
	/// 用户通过服务器发给另一用户的消息
	/// </summary>
	[Serializable]
	abstract public class UserToUserMessage : Message
	{
		/// <summary>
		/// 发送用户
		/// </summary>
		public User From { get; set; }
		/// <summary>
		/// 接收用户
		/// </summary>
		public User To { get; set; }

		/// <summary>
		/// 生成 <see cref="UserToUserMessage"/> class 的新实例。
		/// </summary>
		/// <param name="from">发送用户</param>
		/// <param name="to">接收用户</param>
		public UserToUserMessage(User from, User to)
		{
			if (from == null)
				throw new ArgumentNullException("from");
			if (to == null)
				throw new ArgumentNullException("to");
			From = from;
			To = to;
		}
	}
}
